huanhang = r'<p><br/></p>'


def getDetailHtml(peizhi, chicun, bzq, img):
    """
    获取商品详情
    """
    size = ""
    ShelfLife = ""
    config = ""
    imgPath = ""
    if chicun != "":
        size = sizeHtml(chicun)

    if bzq != "":
        ShelfLife = bzqHtml(bzq)

    if peizhi != "":
        config = peizhiHtml(peizhi) + huanhang

    if img != "":
        imgPath = imgHtml(img)
    return config + ShelfLife + size + imgPath


def imgHtml(str):
    """
    图片信息
    """
    return r'<div><img src="' + str + r'"style="max-width:100%;" contenteditable="false"/></div>'


def peizhiHtml(value):
    """
    商品配置信息
    """
    value = str(value).replace("\n", "<br/>")
    return r'<h3><b id="3chst">内配：</b></h3><h3 id="wwqei"><span style="font-weight: normal;">' + value + r'</span></h3>'


def sizeHtml(str):
    """
    商品尺寸
    """
    return r'<h3 id="in4k9">礼盒尺寸（mm）：<span style="font-weight: normal;">' + str + r'</span></h3>'


def bzqHtml(str):
    """
    商品保质期
    """
    return r'<h3 id="kwyu7">保质期：<span style="font-weight: normal;">' + str + r'</span></h3>'
